package wang.conge.javasedemo.core.thread;
/**
 * @author conge
 * 2016年7月21日
 */
public class JoinDemo {

	public static void main(String[] args) {
		System.out.println("main thread start");
		
		Thread childThread = new Thread(()->{
			System.out.println("child thread start");
			
			try {
				Thread.sleep(5000);
			} catch (Exception e) {
				e.printStackTrace();
			}
			
			System.out.println("child thread end");
		});
		
		childThread.start();
		try {
			childThread.join();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		System.out.println("main thread end");
	}

}
